<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
         <!-- 开发环境版本，包含了有帮助的命令行警告 -->
         <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    </head>
<body>
    <div id="app">
        <ul>
            <li v-for="x in list">
                {{x.text}}---{{x.address}}
            </li>
        </ul>
    </div>

    <script>
        var app =new Vue({
            el:"#app",
            data:{
                list:[
                    {
                        text:"哈哈哈",
                        address:"中国"
                    },
                    {
                        text:"咯咯",
                        address:"湖南"
                    },
                    {
                        text:"嘚嘚",
                        address:"英国"
                    }
                ]
            }  
        });
    </script>

    <div id="app-1">
         <p>{{ message }}</p>
         <button @click="reverseMessage">反转消息</button>
    </div>

    <script>
        var app1 = new Vue({
         el: '#app-1',
         data: {
             message: '七上八下!',
             x:1
          },
        methods: {
             reverseMessage: function () {
             this.message = this.message.split('').reverse().join('')    
       }
    }
   
})
    </script>

    <div id="app-2">
         <p>1+1={{ message }}</p>
         <input v-model="message">
    </div>
    <script>
        var app2 = new Vue({
            el: '#app-2',
            data: {
               message: ''
   },
   beforeCreate: function(){
        console.log('beforeCreate被调试:'+ this.x )

    },
    created: function () {
        console.log('调试:'+ this.x )
    },
    beforeMount: function(){
        console.log('beforeMount被调试:'+ this.x )
    },
    mounted: function(){
        console.log('mounted被调试:'+ this.x )
    },
    beforeUpdate:function(){
        console.log('beforeUpdate被调试:'+ this.x )
    },
    updated(){
        console.log('updated被调试:'+ this.x )
    },
    beforeDestroy(){
        console.log('beforeDestroy被调试:'+ this.x )
    }
   })
    </script>
    
</body>
</html>